<!doctype html>
<html>

<head>
    <meta charset="UTF-8">
    <meta name="view-port" content="width=device-width,height=device-height,initial-scale=1.0,user-scalable=0">
    <title>jpush</title>
    <link rel="stylesheet" type="text/css" href="./css/api.css" />
    <link rel="stylesheet" type="text/css" href="./css/box.css" />
    <script type="text/javascript" src="./script/public.js"></script>
</head>

<body>
    <div id="wrap">
        <div id='header'>
            <div class="back" tapmode="back-active" onclick="api.closeWin()">返回</div>
            <!-- <h1>JPush Portting</h1> -->
            <div class="adpt"></div>
        </div>
        <div id="main">

        </div>
        <div id="footer">
            <!-- <h5>©2018</h5> -->
        </div>
    </div>

</body>
<script type="text/javascript">
    var statusBarHeight = 0;
    apiready = function() {

        var el = document.getElementById('header');
        if (!el) {
            return;
        }
        var isAndroid = (/android/gi).test(navigator.appVersion);
        if (!isAndroid) { //ios沉浸式
            statusBarHeight = 20;
            el.style.paddingTop = '20px';
            return;
        }
        var u = navigator.userAgent;
        var ver = parseFloat(u.substr(u.indexOf('Android') + 8, 3));
        if (ver >= 4.4) { //android沉浸式
            statusBarHeight = 25;
            el.style.paddingTop = '25px';
        }


        openContent('JPush_frm.html', 'main-con');
    }


    function openContent(url, fname, frect) {
        if (!url) {
            return;
        }
        var fn = fname ? fname : 'content_frm';
        var fr = {}; //frame所在的rect区域
        if (frect) {
            fr = frect;
        } else {
            var headerH = 44; //header高度为api.css样式中声明的44px
            var footerH = 30; //footer高度为api.css样式中声明的30px
            fr.marginTop = headerH + statusBarHeight
            fr.marginBottom = footerH;
        }
        api.openFrame({
            name: fn,
            url: url,
            bounces: false,
            rect: fr,
            overScrollMode: 'scrolls'
        });
    }
</script>

</html>
